
package org.come.mouslisten;

import com.tool.pet.PetProperty;
import com.tool.role.RoleData;
import com.tool.role.RoleProperty;
import come.tool.Fighting.FightingMixDeal;
import org.come.Frame.MsgJframe;
import org.come.entity.RoleSummoning;
import org.come.good.Medicine;
import org.come.until.FormsManagement;
import org.come.until.UserMessUntil;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

public class ZDCYMouslisten implements MouseListener {
    private int i;

    public ZDCYMouslisten(int i) {
        this.i = i;
    }

    public void mouseClicked(MouseEvent e) {
    }

    public void mousePressed(MouseEvent e) {
        if (FightingMixDeal.State == 0) {
            Medicine.zdchiyao(this.i);
        }
    }

    public void mouseReleased(MouseEvent e) {


    }

    public void mouseEntered(MouseEvent e) {
        int z = 0;
        long d = 0;
        if (this.i == 0) {
            z = RoleProperty.getHp(RoleData.getRoleData().getLoginResult());
            d = RoleData.getRoleData().getLoginResult().getHp().intValue();
        } else if (this.i == 1) {
            z = RoleProperty.getMp(RoleData.getRoleData().getLoginResult());
            d = RoleData.getRoleData().getLoginResult().getMp().intValue();
        } else {
            RoleSummoning rs;
            int[] pets;
            if (this.i == 2) {
                if (RoleData.getRoleData().getLoginResult().getSummoning_id() == null) {
                    return;
                }

                rs = UserMessUntil.getPetRgid(RoleData.getRoleData().getLoginResult().getSummoning_id());
                pets = PetProperty.getPetHMASp(rs);
                z = pets[0];
                d = rs.getBasishp();
            } else if (this.i == 3) {
                if (RoleData.getRoleData().getLoginResult().getSummoning_id() == null) {
                    return;
                }

                rs = UserMessUntil.getPetRgid(RoleData.getRoleData().getLoginResult().getSummoning_id());
                pets = PetProperty.getPetHMASp(rs);

                z = pets[1];
                d = rs.getBasismp();
            }
        }

        MsgJframe.getJframe().getJapnel().showXF((this.i % 2 == 0 ? "HP:" : "MP:") + d + "/" + z, this.i % 2 == 0 ? "DC143C" : "009ad6");
    }

    public void mouseExited(MouseEvent e) {
        FormsManagement.HideForm(46);
    }
}
